/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package commonInfrastructure.accountManagement.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.OneToMany;


/**
 *
 * @author Wei Haoyang
 */
@Entity
public class RoleEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String roleName;
    
    @OneToMany(targetEntity = FunctionalityEntity.class, cascade = {CascadeType.MERGE})
    private List<FunctionalityEntity> functionalities = new ArrayList<FunctionalityEntity>();
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the RoleName
     */
    public String getRoleName() {
        return roleName;
    }

    /**
     * @param RoleName the RoleName to set
     */
    public void setRoleName(String RoleName) {
        this.roleName = RoleName;
    }

    /**
     * @return the functionalities
     */
    public List<FunctionalityEntity> getFunctionalities() {
        return functionalities;
    }

    /**
     * @param functionalities the functionalities to set
     */
    public void setFunctionalities(List<FunctionalityEntity> functionalities) {
        this.functionalities = functionalities;
    }

    
}
